﻿using Kang.DbDoc.Enums;
using Kang.ExtendMethod;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Kang.DbDoc.Abstracts
{
    public abstract class BaseConnection
    {
        public TableTypeEnum GetTableType(string type)
        {
            switch (type.StringTrim().ToUpper())
            {
                case "VIEW":
                case "V":
                    return TableTypeEnum.View;
            }
            return TableTypeEnum.Table;
        }

        public RoutineTypeEnum GetRoutineType(string type)
        {
            switch (type.StringTrim().ToUpper())
            {
                case "FUNCTION":
                case "FN":
                    return RoutineTypeEnum.Function;
            }
            return RoutineTypeEnum.Procedure;
        }
    }
}
